package com.bangdream.michelia.view.fragment.exam.analysis;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bangdream.michelia.R;
import com.bangdream.michelia.presenter.base.BasePresenter;
import com.bangdream.michelia.view.activity.exam.OnMainActivityListener;
import com.bangdream.michelia.view.fragment.exam.BaseAnswerFragment;

/**
 * @date on 2018/8/19 18:48
 * @email 909732184@qq.com
 * 查看答案解析时的题型缺省页 未知题型展示这个fragment
 */
public class AnalysisDefaultFragment extends BaseAnswerFragment implements View.OnClickListener {
    private View view;
    private TextView btn1,btn2;
    private int nmIndex,nmTotalIndex;
    private TextView tvIndex,tvTotalIndex;
    private OnMainActivityListener onMainActivityListener;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.analysis_exam_default_fragment,container,false);
        return view;
    }

    @Override
    public BasePresenter createPresenter() {
        return null;
    }

    @Override
    public void loadData() {
        initView();
        if(getArguments()!=null){
            nmIndex = getArguments().getInt("index");
            nmTotalIndex = getArguments().getInt("totalIndex");
        }
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(onMainActivityListener!=null)
                    onMainActivityListener.onPageToLast();
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(onMainActivityListener!=null)
                    onMainActivityListener.onPageToNext();
            }
        });
    }

    private void initView() {
        btn1 = view.findViewById(R.id.btn1);
        btn2 = view.findViewById(R.id.btn2);
        tvIndex = view.findViewById(R.id.tvIndex);
        tvTotalIndex = view.findViewById(R.id.tvTotalIndex);
    }

    @Override
    public void setTime(String stTime) {

    }

    @Override
    public void saveAnswer(boolean isFinish, boolean isNext) {

    }

    @Override
    public void setOnMainActivityListener(OnMainActivityListener onMainActivityListener) {
        this.onMainActivityListener = onMainActivityListener;
    }


    @Override
    public void onClick(View v) {

    }
}
